GetEnumerator Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Enumerates all of the items in the list, in order. The item at index 0 is enumerated first, then the item at index 1, and so on. Usually, the foreach statement is used to call this method implicitly.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public override sealed IEnumerator<T> GetEnumerator()
Visual Basic (Declaration)
Public Overrides NotOverridable Function GetEnumerator As IEnumerator(Of T)
Visual C++
public:
virtual IEnumerator<T>^ GetEnumerator () override sealed

Return Value

An IEnumerator<T> that enumerates all the items in the list.

Remarks

Enumerating all of the items in the list take time O(N), where N is the number of items in the list. Using GetEnumerator() or foreach is much more efficient than accessing all items by index.

See Also